Apply a patch by Soeren Sandmann to test long statusbar texts.
authorMatthias Clasen <mclasen@redhat.com>
Tue, 9 Nov 2004 06:14:11 +0000 (06:14 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 9 Nov 2004 06:14:11 +0000 (06:14 +0000)
2004-11-09  Matthias Clasen  <mclasen@redhat.com>

* tests/testgtk.c: Apply a patch by Soeren Sandmann to
test long statusbar texts.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
tests/testgtk.c

index ad83155e691d0599100e2c7068f9538b95969d69..6268ddb2f0cb029865ea56c933932cbf2f59e033 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * tests/testgtk.c: Apply a patch by Soeren Sandmann to 
+       test long statusbar texts.
+
        * gtk/gtk.symbols: Add new symbols.
 
        Avoid resizing GtkStatusbar if the text of the label 
index ad83155e691d0599100e2c7068f9538b95969d69..6268ddb2f0cb029865ea56c933932cbf2f59e033 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * tests/testgtk.c: Apply a patch by Soeren Sandmann to 
+       test long statusbar texts.
+
        * gtk/gtk.symbols: Add new symbols.
 
        Avoid resizing GtkStatusbar if the text of the label 
index ad83155e691d0599100e2c7068f9538b95969d69..6268ddb2f0cb029865ea56c933932cbf2f59e033 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * tests/testgtk.c: Apply a patch by Soeren Sandmann to 
+       test long statusbar texts.
+
        * gtk/gtk.symbols: Add new symbols.
 
        Avoid resizing GtkStatusbar if the text of the label 
index ad83155e691d0599100e2c7068f9538b95969d69..6268ddb2f0cb029865ea56c933932cbf2f59e033 100644 (file)
@@ -1,5 +1,8 @@
 2004-11-09  Matthias Clasen  <mclasen@redhat.com>
 
+       * tests/testgtk.c: Apply a patch by Soeren Sandmann to 
+       test long statusbar texts.
+
        * gtk/gtk.symbols: Add new symbols.
 
        Avoid resizing GtkStatusbar if the text of the label 
index 0ca5a617c8481d53d95cc1d8a71a30048626a61f..006a2ba4eeb2cf929c62f3865eb52bd460208378 100644 (file)
@@ -1212,6 +1212,17 @@ statusbar_push (GtkWidget *button,
   gtk_statusbar_push (statusbar, 1, text);
 }
 
+static void
+statusbar_push_long (GtkWidget *button,
+                     GtkStatusbar *statusbar)
+{
+  gchar text[1024];
+
+  sprintf (text, "Just because a system has menu choices written with English words, phrases or sentences, that is no guarantee, that it is comprehensible. Individual words may not be familiar to some users (for example, \"repaginate\"), and two menu items may appear to satisfy the users's needs, whereas only one does (for example, \"put away\" or \"eject\").");
+
+  gtk_statusbar_push (statusbar, 1, text);
+}
+
 static void
 statusbar_pop (GtkWidget *button,
               GtkStatusbar *statusbar)
@@ -1335,6 +1346,14 @@ create_statusbar (GtkWidget *widget)
                                                 NULL),
                                 "swapped_signal_after::clicked", statusbar_contexts, statusbar,
                                 NULL);
+
+      button = g_object_connect (gtk_widget_new (gtk_button_get_type (),
+                                                "label", "push something long",
+                                                "visible", TRUE,
+                                                "parent", box2,
+                                                NULL),
+                                "signal_after::clicked", statusbar_push_long, statusbar,
+                                NULL);
       
       separator = gtk_hseparator_new ();
       gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
@@ -2021,7 +2040,7 @@ create_handle_box (GtkWidget *widget)
     
     gtk_window_set_screen (GTK_WINDOW (window),
                           gtk_widget_get_screen (widget));
-
+    gtk_window_set_modal (GTK_WINDOW (window), TRUE);
     gtk_window_set_title (GTK_WINDOW (window),
                          "Handle Box Test");
     gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
@@ -2557,21 +2576,25 @@ void create_labels (GtkWidget *widget)
 
       frame = gtk_frame_new ("Normal Label");
       label = gtk_label_new ("This is a Normal label");
+      gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_START);
       gtk_container_add (GTK_CONTAINER (frame), label);
       gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
       frame = gtk_frame_new ("Multi-line Label");
       label = gtk_label_new ("This is a Multi-line label.\nSecond line\nThird line");
+      gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END);
       gtk_container_add (GTK_CONTAINER (frame), label);
       gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
       frame = gtk_frame_new ("Left Justified Label");
       label = gtk_label_new ("This is a Left-Justified\nMulti-line label.\nThird      line");
+      gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_MIDDLE);
       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
       gtk_container_add (GTK_CONTAINER (frame), label);
       gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
 
       frame = gtk_frame_new ("Right Justified Label");
+      gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_START);
       label = gtk_label_new ("This is a Right-Justified\nMulti-line label.\nFourth line, (j/k)");
       gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
       gtk_container_add (GTK_CONTAINER (frame), label);
@@ -10955,6 +10978,7 @@ create_progress_bar (GtkWidget *widget)
 
       pdata->pbar = gtk_widget_new (GTK_TYPE_PROGRESS_BAR,
                                    "adjustment", adj,
+                                   "ellipsize", PANGO_ELLIPSIZE_MIDDLE,
                                    NULL);
       gtk_progress_set_format_string (GTK_PROGRESS (pdata->pbar),
                                      "%v from [%l,%u] (=%p%%)");